import sys

def chomp(line):
    if line == None:
        return None
    if line[-1] == '\n':
        return line[:-1]
    return line